package game.Actors;
import game.Config.Config;
import org.newdawn.slick.Image;
import org.newdawn.slick.geom.Vector2f;
/**
 * This class represents a firebullet in the game.
 * The firebullet extends Fadingbullet, and will thus only travel
 * a given distance before disappearing.
 * When the firebullet collides with an enemy it will make the enemy burn.
 * @author Sebastian Isheden and Victor Beer.
 */
public class FireBullet extends FadingBullet{
	float burnDuration;
	float burnDamage;
	/**
	 * Creates a firebullet based on the given parameters.
	 * @param image The image of the bullet.
	 * @param position The starting position of the bullet.
	 * @param speed The speed of the bullet.
	 * @param direction The direction of the bullet.
	 * @param fadeDistance The distance this bullet will travel before disappearing.
     * @param damage The damage of the bullet.
	 * @param burnDuration The duration this bullet will burn an enemy when it collides with it.
	 * @param burnDamage The damage this bullet will inflict when burning an enemy.
	 */
	public FireBullet(Image image, Vector2f position, float speed,Vector2f direction, float fadeDistance,float damage,float burnDuration,float burnDamage) {
		super(image, position, speed, direction, damage,fadeDistance);
		this.burnDamage = burnDamage;
		this.burnDuration = burnDuration;
	}
	@Override
	protected void explode(Enemy enemy){
		if(!enemy.isDead){
			new FireEffect(Config.fireSheet,enemy.position.copy(),this.burnDuration,enemy,this.burnDamage);
		}
		this.isDead = true;
	}
}